package BeanUtils.T7;

import java.lang.reflect.InvocationTargetException;
import java.util.HashMap;
import java.util.Map;

public class Demo {

    public void demo01() throws InvocationTargetException, IllegalAccessException, InstantiationException {

        Class<Book> bookClass = Book.class;
        Book book = bookClass.newInstance();
        Map<String, Object[]> map = new HashMap<>();
        map.put("bookname", new Object[]{book});
        map.put("author", new Object[]{book});
        map.put("price", new Object[]{book});
        map.put("publishDate", new Object[]{book});

        MyBeanUtils.populate(bookClass,map);
        System.out.println(book);
    }
}